<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-title" content="Amaze UI" />
<link rel="stylesheet" href="../template/assets/css/amazeui.min.css"/>
</head>
<body>
    <div class="am-g am-margin-top">
      <div class="am-u-sm-4 am-u-md-2 am-text-right">
        商务动力宽带订单号：
      </div>
      <div class="am-u-sm-6 am-u-md-8">
        <input class="am-form-field am-text-sm" type="test" id="order-id"/>
      </div>
      <div class="am-u-sm-2 am-u-md-2">
        
      </div>
    </div>
    <div class="am-g am-margin-top">
      <div class="am-u-sm-4 am-u-md-2 am-text-right">
        商务动力宽带流水号：
      </div>
      <div class="am-u-sm-6 am-u-md-8">
        <input class="am-form-field am-text-sm" type="test" id="boss_no"/>
      </div>
      <div class="am-u-sm-2 am-u-md-2">
        <input type="button" id="submit-btn" value="确定" />
      </div>
    </div>
    <div class="am-g am-margin-top">
        <div class="am-u-sm-12 am-u-md-12 am-text-center am-text-danger">
            <p id="msg" name="msg" class="am-kai"></p>
        </div>
    </div>
</body>
</html>
<script type="text/javascript" src="../template/assets/js/jquery.min.js"></script>
<script type="text/javascript" src="../template/assets/js/amazeui.min.js"></script>
<script type="text/javascript" src="../template/website/js/app.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $("#submit-btn").click(function(){
        var params = {"order_id":$("#order-id").val(),"boss_no":$("#boss_no").val()};
        $.ajax({
            type: "post",
            url: "../govBroadbandH5/parseResultTest",
            data: params,
            dataType: "text",
            headers: {
      'token': getParamValue('token'),
      'saleType': getParamValue('saleType')
    },
    success: function(data) {
      if (JSON.parse(result).ResultCode === 1009) {
        alert('登陆超时，请重新登录！');
        jumpToSignin();
        return;
      }
                if(result){
                  var data = {};
                  if(result instanceof Object){
                    data = result;
                  }else{
                    data = JSON.parse(result);
                  }
                  
                  if(data.resCode == 0000000){
                	  $("#msg").html("您的预约订单已成功受理，我们将在48小时之内通过10086联系您。");
                  }else{
                    var msg = data.resMsg;
                    if(!msg){
                      msg = "很报歉，预约失败，请联系管理员！";
                    }
                    $("#msg").html(msg);
                  }
                }else{
                  $("#msg").html("很报歉，预约失败，请联系管理员！");
                }
            },
            error : function(textStatus) {
                $("#msg").html("请求服务器异常！");
                console.log("request error");
            }
        });
    });
});

</script>